home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7679 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  37 lines

  1. Newsgroups: comp.lang.c++
  2. Path: news.eds.co.nz!usenet
  3. From: Ross Smith <ross.smith@nz.eds.com>
  4. Subject: Re: pow(-1,1.1) = DOMAIN error
  5. Content-Type: text/plain; charset=us-ascii
  6. Sender: usenet@nz.eds.com (Usenet News Admin)
  7. Content-Transfer-Encoding: 7bit
  8. Organization: EDS (New Zealand) Ltd
  9. Message-ID: <312D1DA8.3250@nz.eds.com>
  10. References: <Christian.Straka.15.0010E3C9@uni-konstanz.de>
  11. X-Mailer: Mozilla 2.0 (WinNT; I)
  12. Mime-Version: 1.0
  13. X-Nntp-Posting-Host: crazy-harry.lab.nz.eds.com
  14. Date: Fri, 23 Feb 1996 01:51:36 GMT
  15.  
  16. Christian Straka wrote:
  17. > The pow() and powl() function in <math.h> doesn't work properly. The following
  18. > example causes a DOMAIN error exception (see defs in math.h):
  19. >              pow(-1,1.1);
  20. > Has anyone an idea to fix this problem?
  21.  
  22. There isn't a problem. -1 to the power of 1.1 *is* an error -- the result
  23. isn't expressible as a double, because it's a complex number (actually,
  24. it's a choice of ten different complex numbers).
  25.  
  26. Mathematically speaking, it should really be a range error rather than a
  27. domain error, but it's definitely an error.
  28.  
  29. -- 
  30. Ross Smith ........................................ Wellington, New Zealand
  31. Work: <mailto:ross.smith@nz.eds.com> ... Home: <mailto:alien@netlink.co.nz>
  32. "Remember when we told you there was no future? Well, this is it."
  33.                                                                -- Blank Reg
  34.